<template>
  <div>
    <!--已督办事件-->
    <template v-if="queryType === '1'">
      <div @click="repliedClick(item)">
        <p class="gb-card-info">
          <span class="gb-card-info__label">事件标题</span>
          <span class="gb-card-info__value">{{ item.eventName }}</span>
        </p>
        <p class="gb-card-info" v-if="item.list[item.list.length - 3] && this.baseType === '1'">
          <span class="gb-card-info__label">督办意见</span>
          <span class="gb-card-info__value">{{ item.list[item.list.length - 3].visitRecord }}</span>
        </p>
        <p
          class="gb-card-info"
          v-if="(item.list[item.list.length - 1] && this.baseType === '0') || this.baseType === undefined"
        >
          <span class="gb-card-info__label">督办意见</span>
          <span class="gb-card-info__value">{{ item.list[item.list.length - 1].visitRecord }}</span>
        </p>
        <p class="gb-card-info" v-if="this.baseType === '0'">
          <span class="gb-card-info__label">剩余回复时长</span>
          <span class="gb-card-info__value remaining-reply-time">{{ item.surplusTime }}</span>
        </p>
        <p class="gb-card-info" v-if="item.list[item.list.length - 1] && this.baseType === '1'">
          <span class="gb-card-info__label">督办回复</span>
          <span class="gb-card-info__value">{{ item.list[item.list.length - 1].visitRecord }}</span>
        </p>
        <p class="gb-card-info">
          <span class="gb-card-info__label">最新流转记录</span>
          <span class="gb-card-info__value">{{ item.history.activityName }}</span>
        </p>
        <p class="gb-card-info">
          <span class="gb-card-info__label">事件位置</span>
          <span class="gb-card-info__value">{{ item.eventLocation }}</span>
        </p>
      </div>
    </template>
    <!--未督办事件-->
    <template v-if="queryType === '0'">
      <div @click="unsupervisedDetail(item)">
        <p class="gb-card-info">
          <span class="gb-card-info__label">事件来源</span>
          <span class="gb-card-info__value">{{ item.eventOriginName }}</span>
        </p>
        <p class="gb-card-info">
          <span class="gb-card-info__label">上报时间</span>
          <span class="gb-card-info__value">{{ item.reportTime }}</span>
        </p>
        <p class="gb-card-info">
          <span class="gb-card-info__label">事件名称</span>
          <span class="gb-card-info__value">{{ item.eventName }}</span>
        </p>
        <p class="gb-card-info">
          <span class="gb-card-info__label">事件地点</span>
          <span class="gb-card-info__value">{{ item.eventLocation }}</span>
        </p>
      </div>
    </template>
  </div>
</template>
<script>
export default {
  props: {
    item: {
      type: Object,
      default: () => {
        return {}
      }
    },
    // 数据类型
    baseType: {
      type: String
    },
    // 查询详情类型
    queryType: {
      type: String
    },
    // 区分更新和审核（Approve-collection：-分隔，前面区分接口，后面区分路由）
    type: {
      type: String
    }
  },
  data() {
    return {
      new_Positions: []
    }
  },
  created() {},
  methods: {
    repliedClick(item) {
      this.$router.push({
        path: '/cockpit/supervise/detail',
        query: {
          eventCode: item.eventCode,
          type: this.baseType
        }
      })
    },
    unsupervisedDetail(item) {
      this.$router.push({
        path: '/cockpit/supervise/detail/unsupervise',
        query: {
          eventCode: item.eventCode
        }
      })
    }
  }
}
</script>
<style scoped lang="less"></style>
